package com.jprocms.module.cms.controller.admin.job.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * 定时任务 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 */
@Data
public class JobBaseVO {

    @Schema(description = "外部任务id 对应xxl-job任务id", example = "9620")
    private Integer xxlJobId;

    @Schema(description = "job类型（1内容发布 2内容下线 3内容置顶  ）", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotNull(message = "job类型（1内容发布 2内容下线 3内容置顶  ）不能为空")
    private Short jobType;

    @Schema(description = "job名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
    @NotNull(message = "job名字不能为空")
    private String jobName;

    @Schema(description = "cron表达式", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "cron表达式不能为空")
    private String cron;

    @Schema(description = "job参数")
    private String params;

    @Schema(description = "任务执行器name", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "任务执行器name不能为空")
    private String jobHandler;

    @Schema(description = "定时任务关联的数据ID", example = "29869")
    private Long targetId;

    @Schema(description = "备注", example = "你说的对")
    private String remark;

    @Schema(description = "任务调度状态 0-初始化 还未提交到xxljob，1-关闭 2-运行", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "任务调度状态 0-初始化 还未提交到xxljob，1-关闭 2-运行不能为空")
    private Byte status;

    @Schema(description = "创建者", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "创建者不能为空")
    private String createUser;

    @Schema(description = "修改者")
    private String updateUser;

    @Schema(description = "删除标识", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "删除标识不能为空")
    private Boolean deletedFlag;

}
